angular.module('myCtrl', ['bw.paging','ui.bootstrap'])
    .controller('remotes',['$scope','$http',function ($scope,$http) {
        $scope.currentPage = 1;
        $scope.GotoPage = function GotoPage(page, rows) {
            $http({
                method: 'GET',
                url: '/Tremain/ng/findRemote',
                params: {
                    page : page,
                    rows : rows
                }
            }).then(function (res) {
                if (res.data.flag == 1) {
                    $scope.remoteList = res.data.content.list;
                    $scope.my_pageSize = res.data.content.pageSize;
                    $scope.mytotal = res.data.content.total;
                    $scope.pageNum = res.data.content.pageNum;
                } else {
                    window.alert('error');
                }
            }, function (err){
                if (true) {
                } else {
                }
            });
        };

        $scope.GotoPage(1, 20);

    }])
    .controller('homePic',['$rootScope','$scope','$http',function ($rootScope,$scope, $http) {
        $scope.login = function (){
            $http({
                method: 'POST',
                url: '/Tremain/ng/login',
                params: $scope.userinfo
            }).then(function (res) {
                if (res.data.flag == 1) {

                    window.sessionStorage.setItem("class_login", 100);

                    $rootScope.class_login = true;
                } else {
                    window.alert('error');
                }
            }, function (err){
                if (true) {
                } else {
                }
            });
        }

        $scope.logout = function (){
            window.sessionStorage.setItem("class_login", 99);
            $rootScope.class_login = false;
        };

        $scope.click_active = function () {

        }



    }]);



